$(function(){
	//On cache le tableau des questions
	$(".table_grid").fadeOut(0);
	
	$(".generateFile").live("submit", function(){
		var url = $(this).attr("action");
		var data = $(this).serialize();
		
		$.post(url, data, function(retour){
			if(retour.erreur)
			{
				$(".admin_footer_help").empty();
				$(".admin_footer_help").append(retour.erreur);
			}
			else if(retour.reponse)
			{
				$(".generateFile").fadeOut(500, function(){
					$(".admin_footer_help").empty();
					$(".admin_footer_help").append(retour.reponse);
					
					//On vide le tableau des questions
					$(".left_box .contenu_tableau_questions").empty();
				});
			}
		},"json");
		
		return false;
	});
});